package org.example;

public class Test2 {
    //leetcode 344 反转字符串 https://leetcode.cn/problems/reverse-string/description/
    public void reverseString(char[] s) {
        int n = s.length;
        int left = 0, right = n - 1;
        while (left < right) {
            char tmp = s[left];
            s[left++] = s[right];
            s[right--] = tmp;
        }
    }
}
